.class public Lcom/wmr/Lstview/HorizontalListViewAdapter;
.super Landroid/widget/BaseAdapter;
.source "HorizontalListViewAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;
    }
.end annotation


# instance fields
.field iconBitmap:Landroid/graphics/Bitmap;

.field private mContext:Landroid/content/Context;

.field private mIconIDs:[I

.field private mInflater:Landroid/view/LayoutInflater;

.field private mTitles:[Ljava/lang/String;

.field private selectIndex:I


# direct methods
.method public constructor <init>(Landroid/content/Context;[Ljava/lang/String;[I)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "titles"    # [Ljava/lang/String;
    .param p3, "ids"    # [I

    .prologue
    .line 27
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 25
    const/4 v0, -0x1

    iput v0, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->selectIndex:I

    .line 28
    iput-object p1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mContext:Landroid/content/Context;

    .line 29
    iput-object p3, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mIconIDs:[I

    .line 30
    iput-object p2, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mTitles:[Ljava/lang/String;

    .line 31
    iget-object v0, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mContext:Landroid/content/Context;

    const-string v1, "layout_inflater"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    iput-object v0, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 32
    return-void
.end method

.method private getPropThumnail(I)Landroid/graphics/Bitmap;
    .locals 7
    .param p1, "id"    # I
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .prologue
    .line 79
    iget-object v5, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    invoke-virtual {v5, p1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    .line 80
    .local v1, "d":Landroid/graphics/drawable/Drawable;
    invoke-static {v1}, Lcom/wmr/Lstview/BitmapUtil;->drawableToBitmap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 82
    .local v0, "b":Landroid/graphics/Bitmap;
    iget-object v5, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f080002

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getDimensionPixelOffset(I)I

    move-result v4

    .line 83
    .local v4, "w":I
    iget-object v5, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x7f080003

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v2

    .line 85
    .local v2, "h":I
    invoke-static {v0, v4, v2}, Landroid/media/ThumbnailUtils;->extractThumbnail(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v3

    .line 87
    .local v3, "thumBitmap":Landroid/graphics/Bitmap;
    return-object v3
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 35
    iget-object v0, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mIconIDs:[I

    array-length v0, v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .param p1, "position"    # I

    .prologue
    .line 39
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 44
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 4
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    const/4 v3, 0x0

    .line 51
    if-nez p2, :cond_0

    .line 52
    new-instance v0, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;

    invoke-direct {v0, v3}, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;-><init>(Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;)V

    .line 53
    .local v0, "holder":Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;
    iget-object v1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v2, 0x7f03004d

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 54
    const v1, 0x7f0c01e5

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    invoke-static {v0, v1}, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->access$1(Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;Landroid/widget/ImageView;)V

    .line 55
    const v1, 0x7f0c01e6

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    invoke-static {v0, v1}, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->access$2(Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;Landroid/widget/TextView;)V

    .line 56
    invoke-virtual {p2, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 60
    :goto_0
    iget v1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->selectIndex:I

    if-ne p1, v1, :cond_1

    .line 61
    const/4 v1, 0x1

    invoke-virtual {p2, v1}, Landroid/view/View;->setSelected(Z)V

    .line 66
    :goto_1
    # getter for: Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->mTitle:Landroid/widget/TextView;
    invoke-static {v0}, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->access$3(Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;)Landroid/widget/TextView;

    move-result-object v1

    iget-object v2, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mTitles:[Ljava/lang/String;

    aget-object v2, v2, p1

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 67
    iget-object v1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->mIconIDs:[I

    aget v1, v1, p1

    invoke-direct {p0, v1}, Lcom/wmr/Lstview/HorizontalListViewAdapter;->getPropThumnail(I)Landroid/graphics/Bitmap;

    move-result-object v1

    iput-object v1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->iconBitmap:Landroid/graphics/Bitmap;

    .line 68
    # getter for: Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->mImage:Landroid/widget/ImageView;
    invoke-static {v0}, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;->access$4(Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;)Landroid/widget/ImageView;

    move-result-object v1

    iget-object v2, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->iconBitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 70
    return-object p2

    .line 58
    .end local v0    # "holder":Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;
    :cond_0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;

    .restart local v0    # "holder":Lcom/wmr/Lstview/HorizontalListViewAdapter$ViewHolder;
    goto :goto_0

    .line 63
    :cond_1
    const/4 v1, 0x0

    invoke-virtual {p2, v1}, Landroid/view/View;->setSelected(Z)V

    goto :goto_1
.end method

.method public setSelectIndex(I)V
    .locals 0
    .param p1, "i"    # I

    .prologue
    .line 90
    iput p1, p0, Lcom/wmr/Lstview/HorizontalListViewAdapter;->selectIndex:I

    .line 91
    return-void
.end method
